<template>
	<view >
		<!-- <u-search v-model="searchValue" @custom="getProjectList()" @search="getProjectList()"  style="margin: 30rpx;" :showAction="true" actionText="搜索" :animation="true"></u-search> -->
		<u-search customStyle="margin: 30rpx 30rpx 30rpx 30rpx" v-model="searchValue" @search="getProjectList()"
			@custom="getProjectList()" :showAction="true" actionText="搜索" :animation="true"></u-search>
		
		<u-list @scrolltolower="scrolltolower">
			<u-list-item v-for="(item, index) in indexList" :key="index">
				<!-- 					<u-cell title="1111" @click="itemClick(1)">
						<u-avatar slot="icon" shape="square" size="35" customStyle="margin: -3px 5px -3px 0"></u-avatar>
					</u-cell> -->
		
				<view style="margin-top: 20rpx;" class="itemView" 
				@click="itemClick(item.id,item.proTitle,item.proContent,item.proMoney)">
					<u-col>
						<!-- 						<u--text color="#07C160" customStyle="margin: 20rpx 0rpx 0rpx 20rpx"
							:text="'任务时间 '+item.cdate"></u--text> -->
		
						<view style="display: flex; flex-direction: row;">
							<u--image customStyle="margin: 20rpx 0rpx 0rpx 20rpx" :showLoading="true"
								:src="item.proPicture" width="200rpx" height="200rpx"></u--image>
		
							<view style="display: flex; flex-direction: column; width: 100vw;">
								<u--text :bold="true" color="#111111" customStyle="margin: 20rpx 0rpx 0rpx 220rpx"
									:text="item.proTitle"></u--text>
		
		
								<view>
									<u-row>
										<u-col span="6">
											<u-button style="width: 100rpx; height: 45rpx;" type="primary" size="mini"
												text="进行中" color="#69A4D6"
												customStyle="margin: 30rpx 0rpx 0rpx 220rpx"></u-button>
										</u-col>
										<u-col span="6">
											<view>
												<u--text color="red" style="display: inline; float: right;" :text="'￥:'+item.proMoney"
													customStyle="margin: 30rpx 10px 0px 5px"></u--text>
											</view>
		
										</u-col>
		
									</u-row>
		
									<u-row>
										<u-col span="8">
											<view style="display: flex; flex-direction: row;">
												<u-button style="width: 150rpx; height: 45rpx;" type="primary"
													size="mini" text="试玩充场" color="#69A4D6"
													customStyle="margin: 30rpx 0rpx 0rpx 220rpx"></u-button>
												<u-button style=" width: 100rpx; height: 45rpx;" type="primary"
													size="mini" text="主推" color="#E58147"
													customStyle="margin: 30rpx 0rpx 0rpx 30rpx"></u-button>
											</view>
										</u-col>
		
		
										<u-col span="4">
											<view>
												<u-button
													style="display: inline; float: right; width: 100rpx; height: 45rpx;"
													type="primary" size="mini" text="赏金" color="#D81E06"
													customStyle="margin: 30rpx 20rpx 0rpx 0rpx"></u-button>
											</view>
		
										</u-col>
		
									</u-row>
								</view>
		
		
		
							</view>
						</view>
					</u-col>
				</view>
			</u-list-item>
		</u-list>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				indexList: [],
				searchValue: '',
			}
		},
		methods: {
			getProjectList() {
				console.log("getProjectList",this.searchValue)
				if(this.searchValue == "" || this.searchValue == undefined){
					return;
				}
				let param = {
					proType: 0,
					proTitle: this.searchValue,
					pageNum: 1,
					pageSize: 1000,
				}
			
				uni.showLoading({
					title: '请求中...'
				})
				this.$u.api.apiGetProjectList(param).then(res => {
					console.log('apiGetProjectList', res);
					uni.hideLoading();
					if (res.code == 1) {
						this.indexList = res.data.list
					} else {
						this.$u.toast(res.msg);
					}
				})
			},
			
		}
	}
</script>

<style>

</style>
